using System;
using Comms;
using Engine.OldSerialization;

namespace RuthlessConquest {
    public class JoinGameMessage : Message {
        public class Serializer : ISerializer<JoinGameMessage> {
            public void Serialize(InputArchive archive, ref JoinGameMessage value) {
                archive.Serialize("GameId", ref value.GameId);
                archive.Serialize("PlayerName", ref value.PlayerName);
                archive.Serialize("PlayerGuid", ref value.PlayerGuid);
                archive.Serialize("PlayerPlatform", ref value.PlayerPlatform);
                archive.Serialize("PreferredFaction", ref value.PreferredFaction);
            }

            public void Serialize(OutputArchive archive, JoinGameMessage value) {
                archive.Serialize("GameId", value.GameId);
                archive.Serialize("PlayerName", value.PlayerName);
                archive.Serialize("PlayerGuid", value.PlayerGuid);
                archive.Serialize("PlayerPlatform", value.PlayerPlatform);
                archive.Serialize("PreferredFaction", value.PreferredFaction);
            }
        }

        public int GameId;

        public string PlayerName;

        public Guid PlayerGuid;

        public Platform PlayerPlatform;

        public Faction PreferredFaction;

        public PeerData Sender;

        public double ReceiveTime;
    }
}